<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS数据类型</title>
</head>

<body>
    <script>
        /*======变量声明========*/
        var num = 12;
        var str = "字符串  Tom's father";


        let num2 = 13.12;                       // 数字
        let str2 = '字符串2,Tom say:"SSSS". ';   // 字符串
        let myBoolean = true;                   // 布尔

        let myArr = [1, 2, 3, 'dd'];            // 数组
        let obj = { "name": "WEB开发", "code": "Javascript" };    // 对象
        let myFun = x => x ** x;   // 函数

        let unknow;               // undefined
        let unknow2 = null;       // null
        let unknow3 = 3 * 'abc';  // NaN


        //=========常量声明=======
        const conParam = 2.712;
        const PI = 3.1415926;

        // conParam = 3.14;


        //=========类型判断=======
        console.log(typeof conParam);
        console.log(typeof str2);
        console.log(typeof myBoolean);

        console.log(typeof myArr);
        console.log(typeof obj);
        console.log(typeof myFun);

        console.log(unknow);
        console.log(unknow2);
        console.log(unknow3);


    </script>
</body>

</html>